else if (!readonly && r.statuscode==HTTP_OK && !is_hypertext_mime(opt,r.contenttype, fil) && strnotempty(save)) { // pas HTML, Θcrire sur disk directement
r.is_write=1; // Θcrire
if (!dataincache) {
if (fexist(fconv(catbuff, save))) { // un fichier existe dΘja
//if (fsize(fconv(save))==r.size) { // mΩme taille -- NON tant pis (taille mal declaree)
ok=1; // plus rien α faire
filenote(&opt->state.strc,save,NULL); // noter comme connu
file_notify(opt,adr, fil, save, 0, 0, 1); // data in cache
}
}
if (!dataincache && !ok) { // Pas de donnΘe en cache et fichier introuvable : erreur!
if (opt->norecatch) {
file_notify(opt,adr, fil, save, 1, 0, 0);
filecreateempty(&opt->state.strc, save);
//
r.statuscode=STATUSCODE_INVALID;
strcpybuff(r.msg,"File deleted by user not recaught");
ok=1; // ne pas rΘcupΘrer (et pas d'erreur)
} else {
file_notify(opt,adr, fil, save, 1, 1, 0);
r.statuscode=STATUSCODE_INVALID;
strcpybuff(r.msg,"Previous cache file not found");
ok=1; // ne pas rΘcupΘrer
}
}
if (!ok) { // load from cache
file_notify(opt,adr, fil, save, 1, 1, 1); // data in cache
if ((fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-cache/new.ndx")))) { // il existe dΘja un cache prΘcΘdent.. renommer
else if ((fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-cache/new.ndx")))) { // il existe dΘja un cache prΘcΘdent.. renommer
#if DEBUGCA
printf("work with former cache\n");
#endif
if (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-cache/old.dat")))